#!/bin/sh -e

# called by uscan with '--upstream-version' <version> <file>
DIR=flexdock-$2
TAR=../libflexdock-java_$2.orig.tar.gz

# clean up the upstream tarball
# Export to the $DIR directory since there is no directory in 
# the archive
unzip $3 -d $DIR
tar -c -z -f $TAR --exclude '*.doc' --exclude '*.jar' --exclude '*.pdf' $DIR
rm -rf $DIR $3

# move to directory 'tarballs'
if [ -r .svn/deb-layout ]; then
    . .svn/deb-layout
    mv $TAR $origDir
    echo "moved $TAR to $origDir"
fi

exit 0
